package cn.udrm.water.base.v1.frontpages.administration;

import org.springframework.stereotype.Component;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestParam;

import cn.udrm.water.base.v1.commons.annotations.Router;

/**
 * 行政区划首页路由
 * @author liukang
 * @date 2019年3月22日
 */
@Component
@Router(value="router/administration")
public class AdministrationIndexRouter {

	@Router(value="index")
	public String index() {
		return "administration/administrationIndex";
	}
	
	@Router(value="defaultPage")
	public String defaultPage() {
		return "administration/defaultPage";
	}
	
	@Router(value="administrationDetail")
	public String administrationDetail(@RequestParam(value="id") String id, ModelMap modelMap) {
		modelMap.addAttribute("id", id);
		return "administration/administrationDetail";
	}
	
	@Router(value="administrationAdd")
	public String administrationAdd(@RequestParam(value="parentId", required=false) String parentId, @RequestParam(value="id", required=false) String id,
			ModelMap modelMap) {
		modelMap.addAttribute("id", id);
		modelMap.addAttribute("parentId", parentId);
		return "administration/administrationAdd";
	}
}
